<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>component-3父子组件实例</title>
    <script type="text/javascript" src="../assets/js/vue.js"></script>
</head>
<body>
    <h1>component-3父子组件实例</h1>
    <hr>
    <div id="app">
        <pxs></pxs>
    </div>
    <script type="text/javascript">
        //构造器外部写局部注册组件
        var city={
            template:`<div style="color:green;">siChuan of china</div>`
        }
        var pxsComponent={
            template:`
            <div>
                <div style="color:red;">Pxs is pixellion</div>
                <city></city>
            </div>
            `,
            components:{
                "city":city
            }
        }
        
        var app = new Vue({
            el:'#app',
            data:{
                message:'hello world!'
            },
            components:{
                "pxs":pxsComponent
            }

        })
    </script>
</body>
</html>